<%@ page language="java" import="java.util.*" import="java.sql.*" import = "orm.*"  pageEncoding="utf-8" errorPage="errorPage.jsp"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<% 	User tea  =(User) session.getAttribute("Teacher");  
	if (tea == null){
		response.sendRedirect(path + "/index.jsp");
	}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href = "<%=basePath %>"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>学生管理</title>
<link href="css/tStyles.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">
function myFormCheck(theform)
{
   if(theform.theFile.value=="")
    {
       alert("请导入文件")
       theform.theFile.focus;
       return (false);
    }
    else
    {
       str= theform.theFile.value;
       strs=str.toLowerCase();
       lens=strs.length;
       extname=strs.substring(lens-4,lens);
       if(extname!=".xls")
       {
         alert("导入.xls文件")
         return (false);
       }
       else{
           return (true);
       }
    }
}
</script>
</head>

<body>

<% List studentmap = (List)request.getAttribute("Student");
%>
<!-- CONTAINER START -->
<div id = "container">
<!-- HEADER START -->
        <div id = "top">
        	<div id = "navigation">
            	<html:link page="/teacher/teacher.jsp" styleClass = "link">&nbsp;&nbsp;&nbsp;&nbsp;首页</html:link>
                <html:link page="/teacher/notice.jsp" styleClass = "link">&nbsp;&nbsp;&nbsp;&nbsp;通知</html:link>
                <html:link action="manageQuestions.do?action=startManagement" styleClass = "link">&nbsp;&nbsp;&nbsp;&nbsp;题库</html:link>
                <html:link action="manageKnowledges.do?action=startManagement" styleClass = "link">&nbsp;&nbsp;&nbsp;&nbsp;知识点</html:link>
                <html:link action="manageTemplates.do?action=startManagement" styleClass = "link">&nbsp;&nbsp;&nbsp;&nbsp;试卷模板</html:link>
                <html:link action="gradeManagement.do?action=startMana" styleClass = "link">&nbsp;&nbsp;&nbsp;&nbsp;成绩管理</html:link>
                <html:link page="/teacher/studentMana.jsp" styleClass = "link">&nbsp;&nbsp;&nbsp;&nbsp;学生管理</html:link>
            </div>
        </div>
        <!-- HEADER END -->
        
    <!-- LOGIN START -->
        <div id = "login">
        	<div id = "name">
        	<%=tea.getRealname()%>
            </div>
        	<html:link page="/teacher/teacherInfo.jsp" styleClass="viewInfo">·查询个人信息</html:link>
          	<p><html:link page="/teacher/teaModifyPwd.jsp" styleClass="modifyPwd">·修改密码</html:link></p>
            <p><html:link page="/teacher/letter.jsp" styleClass="letter">·站内信</html:link></p>
            <p><html:link forward="logout" styleClass="logout">·注销登录</html:link></p>
  </div>
        <!-- LOGIN END -->
        
        <!-- CLOCK START -->
  <div id = "clock">
  <iframe src="index/clock.html" height="407" width="296" frameborder="0" scrolling="no"
            		marginheight="0" marginwidth="0" id="clockFrame" name="clockFrame"></iframe>
</div>
        <!-- CLOCK END -->
        
        <!-- MAIN START -->
      	<div id = "main">
      	  <div id="xs_search">
          <br /><br />
            &nbsp;&nbsp;<strong><em> 输入学生的用户名搜索</em></strong>&nbsp;&nbsp;&nbsp;&nbsp;
            <form name="searchIDForm" action="searchid.do">
	      	    <input type="text" name="studentId" id="search-text" value="" style="height:30px"/>
	            <input type="submit" id="search-submit" value="GO" style="height:30px; width:40px;" />
	            <br /><br />
            </form>          
      	  </div>
      	  
      	  
      	  
      	  <!-- 模糊搜索 -->
      	  
      	  <div class="xs_s">&nbsp;&nbsp;&nbsp;&nbsp;
      	    <p><strong>模糊搜索</strong>：</p>
      	    <p>&nbsp;</p>
      	    <form  name="fuzzySearch" action="">
      	    <table width="721" border="1" cellpadding="2" cellspacing="2">
      	      <tr>
   	              
      	        <td width="456" rowspan="6" align="center" valign="top">
      	          <label>
      	            <select name="xj_info" size="18" id="xj_info" style="width:400px;">
      	            
      	            <% if(studentmap != null && studentmap.size() > 0){
      	            	for(int i = 0;i< studentmap.size();i++){
      	            	User student = (User)studentmap.get(i);
      	            	if(student.getQtype().intValue() != 0)
      	            	{
      	            		continue;
      	            	}
      	             %>
      	            <%="<option value=\""%>
      	            <%=student.getUserid()%>
      	            <%="\">" %>
      	            <%=student.getUserid()%>
      	            <%=student.getRealname()%>
      	            <%="</option>"%>
      	            <%}%>
      	            <%}%>
      	            
      	            <% if(studentmap == null || studentmap.size() == 0){
      	             %>
      	            <%="<option value=\""%>
      	            <%="0"%>
      	            <%="\">" %>
      	            <%="none"%>
      	            <%="</option>"%>
      	            <%}%>
   	                </select>
      	          </label>
      	        </td> 
   	          </tr>
   	          
      	      <tr>
      	        <td height="18" colspan="2" align="center">
      	          <label>
      	            <input type="submit" name="xs_reset" id="xs_reset" value="GO " style="width:80px;height:40px;" />
   	              </label> &nbsp;&nbsp;&nbsp;&nbsp;
      	          <label>
      	            <input type="submit" name="xj_submit" id="xj_submit" value="重置"style="width:80px;height:40px;" />
   	              </label>
   	            </td>
   	          </tr>
   	        </table>
   	        
   	        </form>
          </div>
          
          
          
          
          <!--批量导入  -->
          
       
          <div class="xs_s">&nbsp;&nbsp;&nbsp;&nbsp;
          <p style="font-size:18px"> 批量导入:</p>
          	<form name="importForm" action="importstudent.do" style="position:absolute; top: 557px; height: 49px; width: 492px;" 
          	enctype="multipart/form-data" method="post" onsubmit="return myFormCheck(this)">
          		<input type="file" name="theFile" style="position:absolute; top: 8px; height: 32px; font-size:18px" />
       	      <input type="submit" value="导入" style="position:absolute; left: 302px; top: 8px; font-size:18px; width: 68px;" />
          	</form>
          </div>
      </div>
   	<!-- MAIN END -->
        
   	<!-- FOOTER START -->
   	<div id = "footer">
  </div>
   	<!-- FOOTER END -->
        
</div>
    <!-- CONTAINER END -->
    
</body>
</html>
